<template>
	<view class="itemcard">
		<view class="u-flex u-flex-between title">
			<view class="l">
				运单编号 {{item.mainLogisticsOrderId}}
			</view>
			<view class="r">
				{{zt}}
			</view>
		</view>
		<view class="f u-flex">
			<view class="l u-flex u-flex-center">
				发
			</view>
			<view class="r">
				<view class="t">
					{{ item.warehouseName }}
					<!-- <text class="jl">5.7km</text> -->
				</view>
				<!-- 	<view class="b">
					浙江省宁波市海曙区中山东路188号
				</view> -->
			</view>
		</view>
		<view class="s u-flex">
			<view class="l u-flex u-flex-center">
				收
			</view>
			<view class="r">
				{{ item.deliveryAddress }}
			</view>
		</view>
		<view class="yytime u-flex">
			预约时间 {{ item.deliveryEndTime||'' }}
		</view>
		<view class="btn u-flex u-flex-between" style="padding: 24rpx;">
			<view style="width: 186rpx;">
				<u-button :customStyle="btnstyle" @click="call">
					<view class="u-flex">
						<text style="margin-right: 14rpx;white-space: nowrap;">{{ item.driverName }}</text>
						<u--image width="30rpx" height="30rpx"
							:src="$z.imgsrc('cc27ba014c4c445bbda7bb4964d1dda6.png')"></u--image>
					</view>
				</u-button>
			</view>
			<view style="width: 186rpx;">
				<!-- <u-button :customStyle="btnstyle" text="异常上报"></u-button> -->
				<u-button type="error" text="查看详情" :customStyle="btnstyle" @click="ontap"></u-button>
			</view>

		</view>
	</view>

</template>

<script>
	export default {
		props: {
			item: {
				typeof: Object,
				default: () => {
					return {}
				}
			},
		},
		data() {
			return {
				offset: [-3, -6],
				background: "#F2E7E0",
				value: 5,
				btnstyle: {
					height: "72rpx",
					fontSize: "26rpx",
					lineHeight: "30rpx"
				},
				status: "loadmore"

			}
		},
		computed: {
			zt() {

				return this.$z.baseobj.logisticsOrderStateOption[this.item.logisticsState]
			}
		},
		methods: {
			call() {
				if (!this.item.salePhone) {
					this.$u.toast("电话查找失败")
					return
				}
				uni.makePhoneCall({
					phoneNumber: this.item.salePhone //仅为示例
				});
			},
			ontap() {
				uni.navigateTo({
					url: "/pagesall/orderxq/orderxq?id=" + this.item.id
				})
			}
		}
	}
</script>

<style lang="scss">
	.itemcard {
		margin: 16rpx 18rpx;
		background-color: #fff;
		border-radius: 20rpx;
		position: relative;

		.yytime {
			background: #F5F5F5;
			margin: 0 24rpx;
			height: 80rpx;
			border-radius: 14rpx;
			padding-left: 58rpx;
			font-size: 26rpx;
			color: #181A1E;
		}

		.title {
			height: 80rpx;
			padding: 0 24rpx;
			font-size: 28rpx;
			border-bottom: 2rpx solid #E7E7EC;

			.l {
				font-size: 28rpx;
			}

			.r {
				// width: 0;
				// flex: 1;

				// .dw {
				// 	font-size: 26rpx;
				// 	padding-right: 10rpx;
				// }
			}
		}

		.s {
			align-items: flex-start;
			padding: 0 24rpx;
			padding-bottom: 28rpx;

			.l {
				width: 68rpx;
				height: 68rpx;
				border-radius: 28rpx;
				background: #DC2626;
				color: #fff;
				font-size: 36rpx;
				transform: scale(0.5);
				margin: -12rpx -17rpx;
				// margin-left: -17rpx;
			}

			.r {
				padding-left: 24rpx;
				color: #181A1E;
				font-size: 30rpx;
				line-height: 44rpx;
				width: 0;
				flex: 1;
			}

		}

		.f {
			align-items: flex-start;
			padding: 0 24rpx;
			position: relative;
			padding-top: 28rpx;

			&::after {
				content: "";
				// width: 2rpx;
				border-left: 2rpx dashed #C0C0C0;
				// height: 10rpx;
				// background: #000;
				position: absolute;
				left: 40rpx;
				top: 46rpx;
				bottom: 0;
			}

			.l {
				width: 68rpx;
				height: 68rpx;
				border-radius: 28rpx;
				background: #181A1E;
				color: #fff;
				font-size: 36rpx;
				transform: scale(0.5);
				margin: -12rpx -17rpx;
				// margin-left: -17rpx;
			}

			.r {
				padding-left: 24rpx;
				padding-top: 10rpx;
				padding-bottom: 44rpx;
				width: 0;
				flex: 1;

				.t {
					color: #181A1E;
					font-size: 30rpx;
					line-height: 32rpx;

					.jl {
						color: #999999;
						font-size: 24rpx;
						padding-left: 10rpx;
					}
				}

				.b {
					color: #999999;
					font-size: 24rpx;
					margin-top: 14rpx;
					line-height: 32rpx;
				}
			}
		}
	}
</style>